package aa.wl;

import java.io.IOException;

import javax.management.AttributeNotFoundException;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.ReflectionException;

public class WebLogicImpl extends AbstractJMXWorker {
	public WebLogicImpl() throws AttributeNotFoundException,
			InstanceNotFoundException, MBeanException, ReflectionException,
			IOException {
		super();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		WebLogicImpl wl;
		try {
			wl = new WebLogicImpl();
			wl.connection = wl.initConnection("cgappt41.qcorpaa.aa.com",
					"7005", "weblogic", "weblogic");
			
			wl.service = new ObjectName(
						"com.bea:Name=EditService,Type=weblogic.management.mbeanservers.edit.EditServiceMBean");
			ObjectName cfgMgr = wl.startEditSession(wl.connection);
			wl.editAdminServerNote(cfgMgr, "MY NOTE");
			
			
		} catch (AttributeNotFoundException e) {
			e.printStackTrace();
		} catch (InstanceNotFoundException e) {
			e.printStackTrace();
		} catch (MBeanException e) {
			e.printStackTrace();
		} catch (ReflectionException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (MalformedObjectNameException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NullPointerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
